-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Draft][CPU][Ref] Support Reduce ops with empty input #27603
base: master
Are you sure you want to change the base?
[Draft][CPU][Ref] Support Reduce ops with empty input #27603
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks promising, thanks for support!
{{{}, {{0, 19, 2, 2, 9}}}}, | ||
{{{}, {{1, 0, 0, 2, 9}}}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests are failing with
Supported Reduce executor is not found
or primType is unexpected : undef_f32 Expected : acl_f32
It's worth to verify with master, because some cases could be originally unsupported as well.
if (dstMemPtr->getSize() > 0) { | ||
init_dst_data(dst_data, dstMemPtr->getSize()); | ||
reduce_kernel_post_process(dst_data); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the previously added check to skip post process if attr.get()->post_ops_.len() == 0
redundant?
testing::Values(ElementType::undefined), | ||
testing::ValuesIn(inputShapes_Dynmic_ZeroDim)), | ||
testing::Values(emptyCPUSpec), | ||
testing::ValuesIn(fusingParamsSet_KeepNoDims), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see the tests for other fusions have been enabled, great!
Have you found what was the root cause of the failures for fusions other than Swish?
5133b7e
to
f9d53fc
Compare
362b15d
to
5aacfd7
Compare
Details:
divisor
inreduce_kernel_post_process
to be zero, and enable post ops fusion of ReduceMean.axesZeroDim
andaxesZeroDimFusing
in test cases, so that all these new added test cases will go exactly to the new added "early return" code block, where input tensor is empty and output tensor is not.makeExecutor
is skipped for the case of empty input on ARM, because Acl library does not support empty input tensor (e.g., NEReduceMean::validate return error). Besides, because of early return, the executor won't be needed anyway.Tickets: